<template>
  <router-view/>
</template>

<script setup>
import {get} from "@/api/request.js";
import {useCounterStore} from "@/stores/counter.js";
import router from "@/router/index.js";

const store = useCounterStore();
// 判断是否登录
if (store.auth.user == null) {
  get('/api/user/info', (message) => {
    store.auth.user = message
    router.push('/index')
  }, () => {
    store.auth.user = null
  })
}


</script>

<style scoped>

</style>
